<?php

class Options extends Model {
    var $name = 'Options';

    function site_title_sanitize($title) {
        return sanitize_title($title);
    }

    function site_description_sanitize($title) {
        return sanitize_title($title);
    }

    function site_url_sanitize($url) {
        $url = stripslashes($url);
        return clean_url($url);
    }

    function site_email_sanitize($email) {
        return preg_replace('/[^a-z0-9+_.@-]/i', '', $email);
    }

    function space_size_sanitize($value) {
        $value = preg_replace('/[^0-9.]/', '', $value);
        $value = ($value * 100)/100;
        return $value . 'M';
    }

    function database_size_sanitize($value) {
        $value = preg_replace('/[^0-9.]/', '', $value);
        $value = ($value * 100)/100;
        return $value . 'M';
    }

    function upload_max_filesize_sanitize($value) {
        $value = preg_replace('/[^0-9.]/', '', $value);
        $value = ($value * 100)/100;
        return $value . 'M';
    }

    function timezone_offset_sanitize($offset) {
        return intval($offset);
    }

    function time_format_sanitize($title) {
        return al_specialchars($title);
    }

}

?>
